-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use latest flashlight code that initializes domain fronting quicker #1257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I haven't tested iOS, but it's working well for me on macOS
In Android it crashes with these logs, That is the same as before that I got while using the new fronted.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting crashes on Android and IOS
Very interesting. Will look. Anything in particular you're doing to reproduce the crashes? |
Create a new go lib |
@@ -100,8 +104,11 @@ type UserConfig struct { | |||
|
|||
// TODO: Implement a timeout mechanism to handle prolonged execution times and potentially execute this method in the background to maintain smooth UI startup performance. | |||
func (cf *configurer) Configure(userID int, proToken string, refreshProxies bool) (*ConfigResult, error) { | |||
// Log the full method run time. | |||
defer func(start time.Time) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@myleshorton Also Running this in IOS, It still takes around, Is this expected?
ios: config.go:109 Configured completed in 7.802894417s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not super surprising, no. What was it taking before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The biggest thing is this method should definitely not block the UI thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not super surprising, no. What was it taking before?
For me, it's the same as before,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The biggest thing is this method should definitely not block the UI thread
Yeah, We might need to make changes soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah in uncensored countries, there won't be much difference. We should, however, look at what is actually taking that time -- I'll eventually trace all this stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1259 This should fix IOS crash and you should be able to run it and see whats going on
@myleshorton Can you take look at this #1259, See if that helps |
Curious if this works for you on iOS now @jigar-f |
@myleshorton it Does't work it crashes because the fronter is nil on RoundTrip |
Huh -- you tested after my last change right? That means that, prior to any of these changes, we would call into the proxied package before we'd initialized the global config at all? |
Yeah, I tested after your changes on adding frontend,it seems right that proxied package gets called before we fetch config. I think it might gets called from session model somewhere init method maybe. |
Yeah I agree -- I think session model might be the culprit. |
@myleshorton I figured out that code takes around 99% time, of Configure Method. here only cf.updateGlobal take around 99% of time. log.Debug("Updating global config")
global, globalUpdated = cf.updateGlobal(cf.rt, global, globalEtag, "https://globalconfig.flashlightproxy.com/global.yaml.gz")
log.Debug("Updated global config")
if refreshProxies {
log.Debug("Refreshing proxies")
proxies, proxiesUpdated = cf.updateProxies(proxies, proxiesEtag)
log.Debug("Refreshed proxies")
} |
This just uses the latest flashlight code that speeds up the selection of working domain fronts on startup, which also speeds up connecting to proxies.